﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Model;
using System.Data;

namespace BLL
{
    public class BasicInformationBO
    {
        public BasicInformationBO() { }

        BasicInformationDAO dao = new BasicInformationDAO();

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(BasicInformation model)
        {
            return dao.Add(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public int Update(BasicInformation model)
        {
            return dao.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public void Delete(int ID)
        {
            dao.Delete(ID);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BasicInformation GetModel(int ID)
        {
            return dao.GetModel(ID);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BasicInformation GetModel(int Type, string ToUserName)
        {
            return dao.GetModel(Type, ToUserName);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BasicInformation GetModel(int Type, int MID)
        {
            return dao.GetModel(Type, MID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dao.GetList(strWhere);
        }

        /// <summary>
        /// 获得前几行数据
        /// </summary>
        //public DataSet GetList(int Top, string strWhere, string filedOrder)
        //{
        //    StringBuilder strSql = new StringBuilder();
        //    strSql.Append("select ");
        //    if (Top > 0)
        //    {
        //        strSql.Append(" top " + Top.ToString());
        //    }
        //    strSql.Append(" ID,Explain,CreateDate ");
        //    strSql.Append(" FROM BasicInformation ");
        //    if (strWhere.Trim() != "")
        //    {
        //        strSql.Append(" where " + strWhere);
        //    }
        //    strSql.Append(" order by " + filedOrder);
        //    return DbHelperSQL.Query(strSql.ToString());
        //}
    }
}
